﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exem
{
    class Studnet
    {
        private int id { get; set; }
        private string name { get; set; }
        private int age;
        public  int Age {
            get {return this.age; }
            set {this.age=value;
                if (age==0)
                {
                    age = 1;
                }
                    }
        }

        public Studnet(int id,string name,int age) {
            this.id = id;
            this.name = name;
            this.Age = age;

        }
        public void Say() {
            Console.WriteLine($"学号：{this.id} 姓名：{this.name}  年龄：{this.age}");
        }
    }
}
